<?php
namespace app\admin\model;

use think\Model;
use think\Db;
use think\facade\Config;
class SpecialModelSeo extends Model
{   

	/*查询数据 */
    public function get_data($URL_Product){
        $list=SpecialModelSeo::where('URL_Product','=',$URL_Product)->find();
        return $list;
    }

    public function update_data($post){
		$data = new SpecialModelSeo;
		// save方法第二个参数为更新条件
		$a=$data->save([
		    'title'  => $post['title'],
		    'zh_title' => $post['zh_title'],
		    'desc' => $post['desc'],
		    'zh_desc' => $post['zh_desc'],
		    'keyword' => $post['keyword'],
		    'zh_keword' => $post['zh_keword']
		],['URL_Product' => $post['URL_Product']]);
		return $a;
    }


    public function insert_data($post){
    	$data  = new SpecialModelSeo;
		$data->URL_Product     = $post['URL_Product'];
		$data->Product_Number     = $post['Product_Number'];
		$data->title     = $post['title'];
		$data->zh_title     = $post['zh_title'];
		$data->desc     = $post['desc'];
		$data->zh_desc     = $post['zh_desc'];
		$data->keyword    = $post['keyword'];
		$data->zh_keword    = $post['zh_keword'];
		$a=$data->save();
		return $a;
    }
}